package com.tianji.learning.controller;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/replies")
@Api(tags = "互动问答-管理端-回复相关接口")
@RequiredArgsConstructor
public class InteractionReplyAdminController {
    private final IInteractionReplyService replyService;


    @ApiOperation("分页查询回答列表")
    @GetMapping("page")
    public PageDTO<ReplyVO> pageQuery(ReplyPageQuery replyPageQuery, boolean isStudent) {
        isStudent=false;
        return replyService.pageQuery(replyPageQuery,isStudent);
    }


    @PutMapping("/{id}/hidden/{hidden}")
    @ApiOperation("管理端隐藏回答")
    public void manageHiddenComments(@PathVariable Long id,@PathVariable boolean hidden){
        replyService.manageHiddenComments(id, hidden);


    }

}
